DROP TABLE IF EXISTS jms_dm.dm_service_site_out_statistics_dt;
CREATE EXTERNAL TABLE jms_dm.dm_service_site_out_statistics_dt(
  billcode string COMMENT '运单号',
  expresscompanycode string COMMENT '快递公司编码',
  province string COMMENT '省份',
  city string COMMENT '城市',
  servicesitecode string COMMENT '服务点编码',
  servicesitename string COMMENT '服务点名称',
  statuscode int COMMENT '状态码',
  self_pickup_current_billcode string COMMENT '当日关联运单号',
  self_pickup_current_statuscode int COMMENT '当日关联运单状态',
  self_pickup_1_billcode string COMMENT 'T+1关联运单号',
  self_pickup_1_statuscode int COMMENT 'T+1关联运单状态',
  self_pickup_3_billcode string COMMENT 'T+3关联运单号',
  self_pickup_3_statuscode int COMMENT 'T+3关联运单状态',
  self_pickup_6_billcode string COMMENT 'T+6关联运单号',
  self_pickup_6_statuscode int COMMENT 'T+6日关联运单状态',
  isInSiteFlag smallint COMMENT "是否入库，1是，0否"
)
    comment  '百世出入库统计报表'
    partitioned by (dt string comment '时间分区')
    stored  as parquet
    location '/dw/hive/jms_dm.db/external/dm_service_site_out_statistics_dt'
    tblproperties (
        'discover.partitions'= 'false',
        'parquet.column.index.access'= 'true'
        );
MSCK REPAIR TABLE jms_dm.dm_service_site_out_statistics_dt;


----add jixk 20230418

ALTER TABLE jms_dm.dm_service_site_out_statistics_dt add COLUMNS(
deliveryflag int comment '是否送货上门'
);